---
layout: default
---

{% for section in site.data.navigation.main %}
{% if section.category == page.category %}
{% assign section-category = section.category %}
{% assign section-title = section.title %}
{% assign section-icon = section.icon %}
{% assign sectioncolor = section.color %}
{% assign section-url = section.url %}
{% endif %}
{% endfor %}
{% if section-title == page.title %}
{% assign section-is-main-page = true %}
{% else %}
{% assign section-is-main-page = false %}
{% endif %}

{% if page.redirect_to %}
<meta http-equiv="refresh" content="0; URL='{{ page.redirect_to }}'" />
{% endif %}

<header id="header" class="header">
    <div class="container">
        <div class="branding">
            <h1 class="logo">
                <span aria-hidden="true" class="icon {{ section-icon }}"></span>
                <span class="text-highlight">{{ section-title }}</span>
                {% unless section-is-main-page %}
                <span class="text-bold">{{ page.title }}</span>
                {% endunless %}
            </h1>
        </div>

        <ol class="breadcrumb" style="font-size: 1.3em;">
            <li><a class="link" href="/">首页</a></li>
            {% for section in site.data.navigation.main %}
            {% if section-title == section.title %}
                <li><strong><a class="link" href="{{ section.url | prepend: site.baseurl }}">{{ section.title }}</a></strong></li>
                {% else %}
                <li><a class="link" href="{{ section.url | prepend: site.baseurl }}">{{ section.title }}</a></li>
                {% endif %}
            {% endfor %}
            {% if site.blog_enabled %}
            <li><a class="link" href="/blog">博客</a></li>
            {% endif %}
        </ol>
    </div>
</header>

<div class="doc-wrapper">
    <div class="container">
        <div class="doc-body">
            <div class="doc-sidebar">
                <nav id="doc-nav">
                    <div id="doc-menu" class="nav doc-menu hidden-xs">
                    {% for item in site.data.navigation.main %}
                    {% if item.category == page.category %}
                    {% assign slug = item.url | split: "/" | last %}
                    {% assign item_url = item.url | remove: slug %}
                    {% include nav.html context=item_url level=0 %}
                    {% endif %}
                    {% endfor %}
                    </div>
                </nav>
            </div>
            <div class="doc-content">
                {% include search.html inline="true" %}

                {% if page.caption != null %}
                <div id="doc-header" class="doc-header">
                    <h1 class="doc-title" id="">{{page.caption}}</h1>
                    <!--  <div class="meta"><i class="fa fa-clock-o"></i> Last updated: Jan 25th, 2016</div>-->

                    <div class="github_edit_page" style="float: right;position:relative;top:-0.6em;">
                        <a href="https://github.com/ktorcn/ktorcn.github.io/edit/master/{{ page.path }}" class="btn btn-default" target="_blank">
                            <i class="fa fa-github" aria-hidden="true" style="font-size:1.5em;"></i> 编辑本页
                        </a>
                    </div>

                    <p>{% include estimated-read-time.html %}</p>
                </div>
                {% endif %}
                {% if page.status == 'todo' %}
                Coming soon...
                {% else %}
                {{ content }}
                {% endif %}
            </div>
        </div>
    </div>
</div>
